package cn.hznc.controller.service.process.logic;

import cn.hutool.core.collection.CollectionUtil;
import cn.hznc.domain.entity.ProcessCraftEntity;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 工艺业务模型
 *
 * @Author Administrator
 * @Date 2023/3/16 8:58
 */
@Getter
@Setter
public class ProcessCraftDo {
    private List<ProcessCraftEntity> createElement= new ArrayList<>();
    private List<ProcessCraftEntity> deleteElement= new ArrayList<>();
    private List<ProcessCraftEntity> updateElement= new ArrayList<>();

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(ProcessCraftEntity element){
        return createElement.add(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addCreateElement(List<ProcessCraftEntity> element){
        return createElement.addAll(element);
    }

    /**
     * 添加删除的元素
     *
     * @param element element
     * @return boolean
     */
    public boolean addDeleteElement(ProcessCraftEntity element){
        return deleteElement.add(element);
    }

    /**
     * 添加删除的元素
     *
     * @param element element
     * @return boolean
     */
    public boolean addDeleteElement(List<ProcessCraftEntity> element){
        return deleteElement.addAll(element);
    }

    /**
     * 添加新增的原素
     *
     * @param element element
     * @return boolean
     */
    public boolean addUpdateElement(ProcessCraftEntity element){
        return updateElement.add(element);
    }


}
